//Effects

function fadeOut()
{
	RenderMap();
	var map_image = GrabImage(0,0, GetScreenWidth(), GetScreenHeight()); // Get Image
	FlipScreen();
	map_image.blit(0,0);
	var alpha = 0;
	var start = GetTime();
	var Log = OpenLog("test.txt");
	while(alpha < 255)
	{
	map_image.blit(0,0);
		Rectangle(0, 0, GetScreenWidth(), GetScreenHeight(), CreateColor(0,0,0, alpha));
		FlipScreen();
		alpha += 5;
		Log.write("Alpha: "+alpha+" TIME: "+GetTime());
		start = GetTime();
		while(start + 25 > GetTime());
	}
}

function fadeIn()
{
	RenderMap();
	var map_image = GrabImage(0,0, GetScreenWidth(), GetScreenHeight()); // Get Image
	FlipScreen();
	map_image.blit(0,0);
	var alpha = 255;
	var start = GetTime();
	var Log = OpenLog("test.txt");
	while(alpha > 0)
	{
	map_image.blit(0,0);
		Rectangle(0, 0, GetScreenWidth(), GetScreenHeight(), CreateColor(0,0,0, alpha));
		FlipScreen();
		alpha -= 5;
		Log.write("Alpha: "+alpha+" TIME: "+GetTime());
		start = GetTime();
		while(start + 25 > GetTime());
	}
}